import {http} from '../utils/http'

// 添加志愿活动
export const addVoluntaryAPI=(data)=>{ 
    return http({
        method: 'POST',
        url: '/voluntary',
        data
    })
}
// 获取志愿活动列表
export const getActivityAPI=(params)=>{ 
    return http({
        method: 'GET',
        url: '/voluntary/list',
       data:params
    })
}
// 获取志愿活动详情
export const getActivityDetailAPI=(activityId)=>{ 
    return http({
        method: 'GET',
        url: `/voluntary/detail/`+activityId,
      
    })
}

// 报名志愿活动
export const signUpVoluntaryAPI=(activityId)=>{ 
    return http({
        method: 'POST',
       url: '/voluntary/addParticipation?activityId=' + activityId
       
    })
}
//搜索志愿活动
export const searchVoluntaryAPI=(params)=>{ 
    return http({
        method: 'GET',
        url: '/voluntary/search',
        data:params
    })
}
// 获取用户申报的志愿活动列表
export const getUserActivityAPI=(params)=>{ 
    return http({
        method: 'GET',
        url: '/voluntary/my-created',
        data:params
    })
}

// 获取用户参加的志愿活动列表
export const getUserActivityDetailAPI=()=>{ 
    return http({
        method: 'GET',
        url: `/voluntary/my-participated`,
    })
}

//签到或者签退
export const signInOrOutAPI=(activityId)=>{ 
    return http({
        method: 'POST',
        url: `/voluntary/signInOrSignOut`+activityId,
    })
}